<?php

/**
 * CategoriaAguaXPeridodo form base class.
 *
 * @method CategoriaAguaXPeridodo getObject() Returns the current form's model object
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseCategoriaAguaXPeridodoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                => new sfWidgetFormInputHidden(),
      'tipo_valor'        => new sfWidgetFormChoice(array('choices' => array('MTS3' => 'MTS3', 'CUOTA' => 'CUOTA'))),
      'valor'             => new sfWidgetFormInputText(),
      'interes'           => new sfWidgetFormInputText(),
      'categoria_agua_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CategoriaAgua'), 'add_empty' => false)),
      'periodo_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Periodo'), 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'                => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'tipo_valor'        => new sfValidatorChoice(array('choices' => array(0 => 'MTS3', 1 => 'CUOTA'), 'required' => false)),
      'valor'             => new sfValidatorNumber(),
      'interes'           => new sfValidatorNumber(),
      'categoria_agua_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('CategoriaAgua'))),
      'periodo_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Periodo'))),
    ));

    $this->widgetSchema->setNameFormat('categoria_agua_x_peridodo[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'CategoriaAguaXPeridodo';
  }

}
